//题号2.63的作业
//题号2.63的作业
//题号2.63的作业
//题号2.63的作业
unsigned srl(unsigned x, int k){
    unsigned xsra = (int) x>>k;
    int w = 8*sizeof(x);
    return ((1u << (w-k))-1)& xsra;
}

int sra(int x, int k){
    int xsrl = (unsigned)x>>k; 
    int w = 8*sizeof(x);
    return (((1u<<(w-1)& x)&&1)*(-1<<(w-k)))|xsrl;
}

//题号2.70的作业
//题号2.70的作业
//题号2.70的作业
//题号2.70的作业
#include <stdio.h>

int fits_bits(int x, int n){
    
    return (x<=((1<<(n-1))-1)&&x>=(-1<<(n-1)))?1:0; 
}

int main(){
    int x, n;

    printf("Enter two integers: ");
    scanf("%d %d",&x,&n);
    printf("%d",fits_bits(x,n));
    return 0;

}
